/**
 * 患教资料库
 * Created by zengtao on 2018/06/19
 */
define(["jquery", "artTemplate","common","text!../tpls/hjzlk/hjzlk.html"], function ($, art,common, page) {
    return function () {
    	$("#mainpage").html(page);
	    	if($("#login_operator_group").val() == "1" || $("#login_operator_group").val() == "0"){
				$(".group-restrictions-hsz").css("display","inline-block");
			}
    		var HJZLK_FN = {
	    		getModuleStatus:function(){
	    			var m = $("#hjzlk-containers div.module-item.active").data("m");
	    			var item = $("#hjzlkListWrap"+m+" .hjzlk-item-li.active").data("id");
	    			return {m:m,item:item}
	    		},
	    		getZdJyjhList:function (type) {
	    			$.get("eduplan/edumonthList.shtml?type="+type, function (res) {
	    				return res.result
	    			})
	    		},
	    		openlayer:function(title,type,jyzt,jynr,width,height,hzListstr,hz_number,hz_name){
	    			var html = '';
	    			switch (type) {
					  case "1":
						 html = '<div style="padding:4px 20px;">' +
							'<div style="display:flex;margin-top: 12px;"><span style="width:78px;font-weight: 600;position:relative;top:4px;">教育月份：</span><input type="text" style="border-radius: 4px;font-family: Arial, Tahoma, Verdana;font-size:15px;" readonly=""  class="form-control form_datetime select-date1 select-date-ym"></div>' +
							'<div style="display:flex;margin-top: 12px;"><span style="width:78px;font-weight: 600;position:relative;top:4px;">教育主题：</span><div style="flex:1;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true" class="ableedit-box jyzt">'+jyzt+'</div></div>' +
							'<div style="display:flex;margin-top: 12px;"><span style="width:78px;font-weight: 600;position:relative;top:4px;">教育内容：</span><div class="ableedit-box gray-bar jynr" style="flex:1;height:306px;overflow:auto;text-align: justify;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true">'+jynr+'</div></div>' +
							'<p style="padding-top:20px;text-align:center;"><button type="button" class="btn btn-primary save-xhz-jyjhb jkjy-commit-btn" style="">确定</button><span class="btn btn-default" style="margin-left:20px;" onclick="closeLayer();">取消</span></p>' +
							'</div>'; 
						 
					    break;
					  case "2":
						  html = '<div style="padding:4px 20px;">' +
							'<div style="display:flex;margin-top: 12px;"><span style="width:78px;font-weight: 600;position:relative;top:4px;">模板名称：</span><div style="flex:1;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true" class="ableedit-box mbmc"></div></div>' +
							'<div style="display:flex;margin-top: 12px;"><span style="width:78px;font-weight: 600;position:relative;top:4px;">教育主题：</span><div style="flex:1;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true" class="ableedit-box jyzt">'+jyzt+'</div></div>' +
							'<div style="display:flex;margin-top: 12px;"><span style="width:78px;font-weight: 600;position:relative;top:4px;">教育内容：</span><div class="ableedit-box gray-bar jynr" style="flex:1;height:306px;overflow:auto;text-align: justify;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true">'+jynr+'</div></div>' +
							'<p style="padding-top:20px;text-align:center;"><button type="button" class="btn btn-primary save-xhz-jyjhb jkjy-commit-btn" style="">确定</button><span class="btn btn-default" style="margin-left:20px;" onclick="closeLayer();">取消</span></p>' +
							'</div>';
						  break;
					  case "3":
						  html = '<div style="padding:4px 20px;">' +
							'<div style="display:flex;margin-top: 12px;"><span style="min-width:80px;font-weight: 600;position:relative;top:4px;">教育主题：</span><div style="flex:1;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true" class="ableedit-box jyzt">' + jyzt + '</div></div>' +
							'<div style="display:flex;margin-top: 12px;"><span style="min-width:80px;font-weight: 600;position:relative;top:4px;">教育目标：</span><select class="form-control jymb" style="width:120px;" ><option value="2">了解</option><option value="4">熟悉</option><option value="3">掌握</option></select>' +
							'<span style="min-width:80px;margin-left:40px;font-weight: 600;position:relative;top:4px;">教育时机：</span><input type="number" class="jysj form-control" style="width:120px;" value=""></div>' +
							'<div style="display:flex;margin-top: 12px;"><span style="min-width:80px;font-weight: 600;position:relative;top:4px;">教育内容：</span>' +
							'<div class="ableedit-box gray-bar jynr" style="flex:1;height:306px;overflow:auto;text-align: justify;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true">'+jynr+'</div>' +
							'</div><p style="padding-top:20px;text-align:center;"><button type="button" class="btn btn-primary save-xhz-jyjhb jkjy-commit-btn" style="">确定</button>' +
							'<span class="btn btn-default" style="margin-left:20px;" onclick="closeLayer();">取消</span></p></div>';
						  break;
					  case "wx":
						  html = '<div style="padding:4px 20px;">' +
							'<div style="display:flex;margin-top: 12px;"><span style="min-width:78px;font-weight: 600;position:relative;top:4px;">患者姓名：</span><div style="flex:1;padding: 6px;">'+hzListstr+'</div></div>' +
							'<div style="display:flex;margin-top: 12px;"><span style="min-width:78px;font-weight: 600;position:relative;top:4px;">教育主题：</span><div style="flex:1;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true" class="ableedit-box jyzt">'+jyzt+'</div></div>' +
							'<div style="display:flex;margin-top: 12px;"><span style="min-width:78px;font-weight: 600;position:relative;top:4px;">教育内容：</span><div class="ableedit-box gray-bar jynr" style="flex:1;height:306px;overflow:auto;text-align: justify;padding: 6px;border-radius: 4px;border: 1px solid #d7d7d7;"  contenteditable="true">'+jynr+'</div></div>' +
							'<p style="padding-top:20px;text-align:center;"><button type="button" class="btn btn-primary save-xhz-jyjhb jkjy-commit-btn" style="">确定</button><span class="btn btn-default" style="margin-left:20px;" onclick="closeLayer();">取消</span></p>' +
							'</div>';
						  break;
					  default:
						  break;
					}
	    			
	    			var layerIndex = layer.open({
						title: [title, 'font-size:18px;background:#EFF2F5;'],
						type: 1,
						closeBtn: 1,
						id: "useToJyjhLayer",
						shadeClose: false,
						area: [width, height],
						resize: false,
						content: html,
						end:activeEduCallbackfn(layerIndex)
					});
	    			init_datetimepicker_ym3();
	    			$("#useToJyjhLayer div.jynr").on("paste", function (e) {
	    			    textInit(e)
	    			});
	    			$("#useToJyjhLayer input.jysj").on("keyup",function(){
	    				this.value=this.value.replace(/\D/g,'')
	    			})
					var $that = $("#useToJyjhLayer");
					$that.find("span.view-all-hzlist").click(function(){
						var hzlist = '<div style="padding:20px;height:100%;overflow:auto;">';
						for(var k=0;k<hz_name.length;k++){
							hzlist += '<span style="margin:0 16px 6px 0;min-width:46px;">'+hz_name[k]+'</span>';
						}
						hzlist += '</div>';
						var layerIndex = layer.open({
							title: false,
							type: 1,
							closeBtn: 2,
							shadeClose: true,
							area: ['600px', '360px'],
							resize: false,
							content: hzlist
						});
						
					})
					$("#useToJyjhLayer .jkjy-commit-btn").off().on("click",function(){
						var jh_date = $that.find("input.select-date-ym").val();
						if(jh_date){
							jh_date += "-01";
						}
						var jh_name = $that.find("div.mbmc").text().replace(/\s/,"");
						var jh_subject = $that.find("div.jyzt").text().replace(/\s/,"");
						var jh_content = $that.find("div.jynr").html().replace(new RegExp(/\n|\t/g,'g'),"");
						if (!jh_subject || !jh_content ) {
							layer.msg("请将信息填写完整!")
							return false;
						}
						if (!jh_name && type == 2) {
							layer.msg("请将信息填写完整!")
							return false;
						}
						if(jh_subject.length > 100){
							layer.msg("教育主题不能超过100个字!")
							return;
						}
						if(jh_content.length > 10000){
							layer.msg("教育内容不能超过10000个字!")
							return;
						}
						var flag = true;
						switch (type) {
						  case "1"://月度教育
							  	$.get("eduplan/existsEdumonth.shtml?jh_date="+jh_date, function (res) {
									if(res.result == '1'){
										layer.alert('添加的月份已有内容，是否替换？', function(index){
											commitToJkjy("",jh_subject,jh_content,jh_date,1,layerIndex)
										  layer.close(index);
										});
									}else{
										commitToJkjy("",jh_subject,jh_content,jh_date,1,layerIndex)
									}
								})
						    break;
						  case "2"://重点教育
							  	$.get("eduplan/edumonthList.shtml?type="+2, function (res) {
				    				var mbname = res.result;
				    				$(mbname).each(function(i,v){
										var text = $.trim($(v).text());
										if(text == jh_name){
											$that.find("div.mbmc").addClass("warn-border");
											layer.msg("此模板名称已存在！")
											flag = false;
											setTimeout(function(){
												$that.find("div.mbmc").removeClass("warn-border");
											},3000)
											return false;
										}
									})
									
									if(!flag){
										return
									}
				    				commitToJkjy(jh_name,jh_subject,jh_content,"",2,layerIndex)
								})
							  break;
						  case "3":
							  	var data = {};
							  	data.jh_subject = $that.find("div.jyzt").text().replace(/\s/,""); //主题
								data.jh_propose = $that.find("select.jymb").val(); //目标
								data.jh_serial = parseInt($that.find("input.jysj").val()); //时机
								data.jh_content = $that.find("div.jynr").html().replace(new RegExp(/\n|\t/g,'g'),"");
								if (!data.jh_subject) {
									layer.msg("教育主题不能为空!")
									return false;
								}
								if (!data.jh_serial) {
									layer.msg("教育时机不能为空!")
									return false;
								}
								if (isNaN(data.jh_serial)) {
									layer.msg("教育时机填写有误!")
									return false;
								}
								if (!data.jh_content) {
									layer.msg("教育内容不能为空!")
									return false;
								}
								if (data.jh_subject.length > 500) {
									layer.msg("教育主题不能超过500字!")
									return false;
								}
								if (data.jh_content.length > 10000) {
									layer.msg("教育内容不能超过10000字!")
									return false;
								}
								//console.log(data)
								if (!data) {
									return false
								}
							  	$.post("eduplan/insertEdunew.shtml", data, function (res) {
									if (res.status === "0") {
										layer.msg("添加成功!");
										activeEduCallbackfn(layerIndex)
									}
								})
							  break;
						  case "wx":
							var edu_date = common.dateNowYmd(),
								edu_subject = $that.find("div.jyzt").text().replace(/\s/,""),
								edu_content = $that.find("div.jynr").html().replace(new RegExp(/\n|\t/g,'g'),"");
							
							$.ajax({
								url: "eduextend/sendWxedumonth.shtml",
								type: "POST",
								data: {
									"arraynumber": hz_number,
									"edu_date": edu_date,
									"edu_subject":edu_subject,
									"edu_content":edu_content
								},
								traditional: true,
								success: function (res) {
									if (res.status === "0") {
										layer.msg("操作成功！")
										activeEduCallbackfn(layerIndex)
									}
								}
							})
							  break;
						  default:
							  break;
						}
					})
	    		}
	    	};
    		
    		function commitToJkjy(jh_name,jh_subject,jh_content,jh_date,type,layerIndex){
    			$.post("eduplan/insertEdumonth.shtml", {"jh_name":jh_name,"jh_subject":jh_subject,"jh_content":jh_content,"jh_date":jh_date,"jh_type":type}, function (res) {
    				if (res.status === "0") {
						layer.msg("添加成功!");
						activeEduCallbackfn(layerIndex)
					}
				})
    		}
    		
    		
    		//切换顶部几个模块的显示
	    	$("#hjzlk-containers div.module-item").on("click",function(){
	    		activeEduCallbackfn()
				$("#hjzlk-containers div.module-item").removeClass("active");
				$("ul.hzjlk-left-bq-wrap,div.hjzlk-content-wrap").addClass("hidden");
				var m = $(this).data("m");
				$(this).addClass("active");
				$("#hjzlkListWrap"+m).removeClass("hidden")
				$("#hjzlkContentWrap"+m).removeClass("hidden")
			})
    	
	    	//显示单个标题的内容
			$("li.hjzlk-item-li").on("click",function(){
				$(this).siblings("li.hjzlk-item-li").removeClass("active");
				$(this).addClass("active");
				var id = $(this).data("id");
				var type = $(this).data("type");
				$("#hjzlkContentWrap"+type+" div.content-sub-item").addClass("hidden");
				$("#hjzlkContentWrap"+type+" div."+id).removeClass("hidden");
				activeEduCallbackfn()
				if(type === 3){
					//getSzjggnContent(id)
				}
				//getYdJyjhContent(id,"#wcxhzYdjyjhContentWrap")
			})
			
			//展开或收缩内容子标题详情
			$(".content-item-title").on("click",function(){
				$(this).next(".content-item-info").toggleClass("active");
			})
			$(".content-item-title").on("click","input.hjzlk-select-box",function(event){
    			event.stopPropagation();
    		})
			//应用到教育计划表
			$("span.to-eduplan").on("click",function(){
				var m = $(this).data("m"),url="eduplan/insertEdumonth.shtml",type,title,jyzt,jynr;
				var status = HJZLK_FN.getModuleStatus();
				$("span.to-eduplan").removeClass("active");
				$(this).addClass("active");
				$("#commit-tojyjhb-wrap").data("action","to-edu");
				var $contentBox = $("div.content-sub-item."+status.item);
				$contentBox.addClass("active");
				if($contentBox.find("div.content-item-title").length === 1){
					$contentBox.find(".hjzlk-select-box").prop("checked",true)
				}else{
					$contentBox.find(".hjzlk-select-box").prop("checked",false)
				}
				
				switch (m) {
				  case 0:
					  type = "1";
					  title = "添加月度教育计划表";
				    break;
				  case 1:
					  type = "2";
					  title = "添加重点教育计划表";
					  break;
				  case 2:
					  type = "3";
					  title = "添加新患者教育计划表";
					  break;
				  default:
					  url = "eduplan/insertEdunew.shtml";
					  break;
				}
				$("#commit-tojyjhb-wrap").removeClass("hidden");
				$("#commit-tojyjhb-wrap .sure-edu")[0].onclick = function(){
					if($contentBox.find("div.content-item-title .hjzlk-select-box:checked").length < 1){
						layer.msg("请勾选需要应用的内容")
						return false
					}
					var jyzt,jynr = "",html;
					if($contentBox.find("div.content-item-title .hjzlk-select-box:checked").length === 1){
						jyzt = $contentBox.find("div.content-item-title .hjzlk-select-box:checked").parent().text().replace(/\s/g,"").replace(/^\d+(\.)/,"");
						jynr = $contentBox.find("div.content-item-title .hjzlk-select-box:checked").parent().next().prop("outerHTML");
					}else{
						jyzt = $("#hjzlkListWrap"+status.m+" .hjzlk-item-li.active .list-item-zt").text();
						$contentBox.find(".hjzlk-select-box").each(function(i,v){
							if($(this).prop("checked")){
								jynr += '<div>'+$(this).parent().text()+'</div><div>'+$(this).parent().next().prop("outerHTML")+'</div>';
							}
						})
					}
					var layer_width = "850px",layer_height = "538px";
					HJZLK_FN.openlayer(title,type,jyzt,jynr,layer_width,layer_height);
				}
				
				$("#commit-tojyjhb-wrap .cancel-edu")[0].onclick = function(){
					activeEduCallbackfn()
				}
			})
			
			//确定应用到教育表或取消
			function activeEduCallbackfn(index){
	    		$("span.to-eduplan").removeClass("active");
	    		$("div.content-sub-item.active").removeClass("active")
	    		$("#commit-tojyjhb-wrap").addClass("hidden");
	    		$("#commit-tojyjhb-wrap .sure-edu")[0].onclick = null;
	    		if(index){
	    			layer.close(index)
	    		}
	    		$("input.hjzlk-select-box").prop("checked",false)
	    	}
	    	
	    	function searchWxpushhzList(){
	    		$.ajax({
					url:"eduextend/neweduList.shtml?tx_number="+tx_number,
					async:false,
					success:function(res){
						if(res.result.length < 1){
							hasNewflag = false;
						}
					}
				})
	    	}
	    	//微信推送患教资料库内容
	    	$("#push-hzzlk-info").on("click",function(){
	    		var m = $(this).data("m"),url="eduplan/insertEdumonth.shtml",type,title,jyzt,jynr;
				var status = HJZLK_FN.getModuleStatus();
				$("span.to-eduplan").removeClass("active");
				$(this).addClass("active");
				$("#commit-tojyjhb-wrap").data("action","push-wx");
				var $contentBox = $("div.content-sub-item."+status.item);
				$contentBox.addClass("active");
				if($contentBox.find("div.content-item-title").length === 1){
					$contentBox.find(".hjzlk-select-box").prop("checked",true)
				}else{
					$contentBox.find(".hjzlk-select-box").prop("checked",false)
				}
				
				$("#commit-tojyjhb-wrap .cancel-edu")[0].onclick = function(){
					$contentBox.removeClass("active");
					$contentBox.find(".hjzlk-select-box").prop("checked",false);
					$("#commit-tojyjhb-wrap").addClass("hidden");
				}
				$("#commit-tojyjhb-wrap").removeClass("hidden");
				
				$("#commit-tojyjhb-wrap .sure-edu")[0].onclick = function(){
					if($contentBox.find("div.content-item-title .hjzlk-select-box:checked").length < 1){
						layer.msg("请勾选需要推送的内容")
						return false
					}
					var pushFlag = false,hzstr = '',hzListstr = '';
					$.ajax({
						url:"eduexe/eduhzList.shtml?searchkey=&grouptype=0&searchdate=&searchbc=&searchlb=&userid=&isbind=1",
						async:false,
						success:function(res){
							if(res.result.length < 1){
								layer.alert("当前没有患者绑定微信，不能推送")
								pushFlag = true;
							}else{
								res.result.forEach(function(v,i){
									hzstr += '<tr class="push-item-'+ v.tx_number +'"><td style="width:15%;"><input type="checkbox" class="push-hjzlk-select-box" data-id="'+v.tx_number+'" data-name="'+v.tx_name+'"></td><td style="width:20%;">'+(i+1)+'</td><td style="width:35%;">'+v.tx_number+'</td><td style="width:30%;">'+v.tx_name+'</td></tr>';
								});
								var selectHzStatusHtml = '<div style="padding:20px 10px;"><input type="text" class="search_input jypghz-search-ipt" style="background: #fff url(image/search.png) no-repeat 12px center / 20px 20px;" placeholder="请输入患者姓名/首拼/透析号"><span style="float:right;">当前已选择患者数量：<span class="yet-select-count" style="min-width:40px;"></span></span></div>';
								hzstr = selectHzStatusHtml + '<div style="padding:0 10px;position:relative;"><div class="clone-table-push" style="position:absolute;z-index:1;background:#fff;"><table class="select-wxts-hjzlk-wrap table table-bordered" style="margin-bottom:0;"><thead><tr><td style="width:15%;"><input type="checkbox" name="" id="checkAll-wxts-hjzlk"></td><td style="width:20%;">序号</td><td style="width:35%;">透析号</td><td style="width:30%;">姓名</td></tr></thead></table></div><div style="height:400px;overflow-y:auto;padding-top:40px;margin-bottom:20px;"><table class="show-list-table select-wxts-hjzlk-wrap table table-bordered" style="margin-bottom:0;"><tbody>'+hzstr+'</tbody></table></div></div>'+
								'<p style="padding-top:20px;text-align:center;border-top: 1px solid #e7e7e7;"><button type="button" class="btn btn-primary sure-selecthz-btn jkjy-commit-btn" style="">确定</button><span class="btn btn-default" style="margin-left:20px;" onclick="closeLayer();">取消</span></p>'
								
							}
						}
					})
					if(pushFlag){
						return false;
					}
					var layerIndex2 = layer.open({
						title: ["选择患者", 'font-size:18px;background:#EFF2F5;'],
						type: 1,
						closeBtn: 1,
						id: "selectPushHzLayer",
						shadeClose: false,
						area: ["850px", "620px"],
						resize: false,
						content: hzstr
					});
					var $openLayer = $('#selectPushHzLayer');
					
					$openLayer.find("div.clone-table-push").css("width",$openLayer.find(".show-list-table").outerWidth());
					var selectList = [];
					$('#selectPushHzLayer input.push-hjzlk-select-box').click(function(){
						if($("#selectPushHzLayer input.push-hjzlk-select-box:checked").length === $("#selectPushHzLayer input.push-hjzlk-select-box").length){
							$("#checkAll-wxts-hjzlk").prop("checked",true)
						}else{
							$("#checkAll-wxts-hjzlk").prop("checked",false)
						}
						setSelectStatus();
					})
					$("#checkAll-wxts-hjzlk").off().click(function(){
						$("#selectPushHzLayer input.push-hjzlk-select-box").prop("checked",$(this).prop("checked"));
						setSelectStatus();
					})
					
					function setSelectStatus(){
						selectList = [];
						$("#selectPushHzLayer input.push-hjzlk-select-box:checked").each(function(i,v){
							selectList.push($(this).data("id"));
						});
						$openLayer.find("span.yet-select-count").text(selectList.length);
					}
					
					//搜索需要推送的患者
					$openLayer.find("input.search_input").on("keyup",function(){
						$.get("eduexe/eduhzList.shtml?searchkey="+$(this).val()+"&grouptype=0&searchdate=&searchbc=&searchlb=&userid=&isbind=1",function(res){
							$("tr.no-data-tr").remove();
							$openLayer.find("tbody tr").addClass("hidden");
							if(res.result.length){
								$(res.result).each(function(i,v){
									var tx_number = v.tx_number;
									$("tr.push-item-"+tx_number).removeClass("hidden");
								});
							}else{
								$openLayer.find("tbody").append("<tr class='no-data-tr'><td colspan=4>未查询到数据</td></tr>");
							}
							$openLayer.find("div.clone-table-push").css("width",$openLayer.find(".show-list-table").outerWidth());
						})
					});
					
					$("#selectPushHzLayer .sure-selecthz-btn").on("click",function(){
						var arraynumber = [],arr_name = [];
						if($("#selectPushHzLayer input.push-hjzlk-select-box:checked").length){
							$("#selectPushHzLayer input.push-hjzlk-select-box:checked").each(function(i,v){
								arraynumber.push($(this).data("id"))
								arr_name.push($(this).data("name"))
								if(i < 8){
									hzListstr += '<span style="margin:0 16px 6px 0;">'+$(this).data("name")+'</span>';
								}
								
								if(i === 8){
									hzListstr += '<span style="margin:0 16px 6px 0;color: #64bbf9;" class="view-all-hzlist" data-status="up">&nbsp;&nbsp;显示全部<span class="iconfont icon-icon1" ></span></span>'
								}
							})
							
							var jyzt,jynr = "",html;
							if($contentBox.find("div.content-item-title .hjzlk-select-box:checked").length === 1){
								jyzt = $contentBox.find("div.content-item-title .hjzlk-select-box:checked").parent().text().replace(/\s/g,"").replace(/^\d+(\.)/,"");
								jynr = $contentBox.find("div.content-item-title .hjzlk-select-box:checked").parent().next().prop("outerHTML");
							}else{
								jyzt = $("#hjzlkListWrap"+status.m+" .hjzlk-item-li.active .list-item-zt").text();
								$contentBox.find("div.content-item-title .hjzlk-select-box:checked").each(function(i,v){
										jynr += '<div>'+$(this).parent().text()+'</div><div>'+$(this).parent().next().prop("outerHTML")+'</div>';
								})
							}
							var layer_width = "892px",layer_height = "538px";
							layer.closeAll()
							HJZLK_FN.openlayer("微信推送","wx",jyzt,jynr,layer_width,layer_height,hzListstr,arraynumber,arr_name);
						}else{
							layer.msg("请选择患者")
						}
					})
				}
	    	})
	    	
	    	//获取肾脏结构和功能列表--测试用
	    	function getHjzlkPart1(type){
	    		$.get("eduplan/edumonthList.shtml?type=2", function (res) {
					//console.log(res)
					var arr = res.result,str='',contentStr;
					if (arr.length == 0) {
						$("#hjzlkListWrap").html('<li style="height:60px;line-height:60;text-align:center;">暂无数据</li>');
						$("#hjzlkContentWrap").addClass("hidden");
						return
					}
					for(var i = 0;i< arr.length;i++){
						str += '<li class="list-item-view hjzlk-item-li" data-type="'+type+'" data-id="'+arr[i].id+'" data-zt="'+arr[i].jh_subject+'" data-jh_name="'+arr[i].jh_name+'"><span class="list-item-xh">'+(i+1)+'</span><span class="list-item-zt">'+arr[i].jh_subject+'</span></li>'
					}
					$("#hjzlkListWrap").html(str);
					try{$("#hjzlkListWrap li.hjzlk-item-li").eq(0).click()}catch(e){}
				})
	    	}
	    	//getHjzlkPart1(1)
       
	    	//获取肾脏结构内容
	    	function getSzjggnContent(id){
	    		$.get("eduplan/edumonthByid.shtml?id="+id,function(res){
					$("#hjzlkContentWrap").html(res.result.jh_content).removeClass("hidden");
				})
	    	}
        };
  });